#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+5;
template<typename T>void read(T &x){
    x=0;char c=getchar();int f=1;
    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
    for(;isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^48);
    x*=f;
}
ll n,lft=0,now=0,ans=0;
ll a[N],b[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    read(n);
    for(ll i=1;i<=n;i++){
        read(a[i]);
        b[a[i]]++;
    }
    for(ll i=1;i<=1e5;i++){
        ans+=min(lft,b[i]);
        lft=lft+b[i]-min(b[i],lft);
    }
    cout<<n-ans;
    return 0;
}
